<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">

<head>
    <div th:replace="m/head :: head"></div>

    <title>优惠券</title>
</head>

<body class="body-gray">

<div th:replace="m/head :: body('banner.hidden', 'head-no-menu', '优惠券')"></div>

<!--主体内容-->
<div class="myCoupon-content">
    <ul>
        <li th:each="item:${discountCoupons}" th:switch="${item.price}" th:attr="data-id=${item.id}">
            <img th:src="@{'/static/m/img/coupon' + ${#numbers.formatDecimal(item.price,1,0)} + '.png'}"/>
            <div class="left">
                <div class="up">
                    <h3>￥<span th:text="${#numbers.formatDecimal(item.price,1,0)}"></span></h3>
                </div>
                <div class="down" th:text="${'有效期：' + #dates.format(item.expirationDate, 'yyyy-MM-dd')}">

                </div>
            </div>
            <div class="right">
                <a th:href="@{'/personal/discountcoupon/present?id=' + ${item.id}}">赠送</a>
                <a th:href="@{/private}">使用</a>
            </div>
        </li>
    </ul>

    <div th:if="${discountCoupons ne null and discountCoupons.size() lt 2}" style="text-align: center; padding: 20px;">
        <div class="foot-box"></div>
    </div>

    <div th:if="${discountCoupons eq null or discountCoupons.size() eq 0}" style="text-align: center; padding: 20px;">
        还没有优惠券, 快去选购作品吧, 小鹿会给您返惠的!
        <div class="foot-box"></div>
        <div class="foot-box"></div>
    </div>
</div>

<div th:replace="m/foot :: foot"></div>

</body>

<div th:replace="m/foot :: footer('')"></div>

</html>
